/*
 * Copyright (c) 2013-2013 XXXX XXXXXX, Inc.
 * XXXX Road, XXXX, XXXX State, XXXX Post code, XXXX Country.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of XXXX
 * XXXXXX, Inc. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with XXXX.
 * 
 * History
 * Date        Ver Author        Change Description
 * ----------- --- ------------- ----------------------------------------
 * 31 May 2013 002 Karl          Create, add function to navigate to tabs, etc.
 */
package test.com.sms.selenium.sms.resourcemanagement.util;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.Select;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class RmResourceManagementPersonPageUtil extends SeleniumPageUtil {
	public final static By PERSON_BUTTON_CLOSE = By.id("feDialogClose");
	public final static By PERSON_BUTTON_SAVE = By.id("savefedata");
	public final static By PERSON_DIV_ERROR_DIALOG = By.className("errorDialogTextbox");
	public final static By PERSON_SPAN_OK_BUTTON_FOR_ERROR_DIALOG = By.className("ui-button-text");
	
	/** tab*/
	public final static By PERSON_TAB_ABOUT = By.xpath("//*[@id='field-engineers-tabs']/ul/li/a[text()='About'][@style='display: none;']/../preceding-sibling::li[1]/a");
	public final static By PERSON_TAB_ADDRESS = By.xpath("//*[@id='field-engineers-tabs']/ul/li/a[text()='Addresses'][@style='display: none;']/../preceding-sibling::li[1]/a");
	public final static By PERSON_TAB_CONTRACT_INFO = By.xpath("//*[@id='field-engineers-tabs']/ul/li/a[text()='Contact Info']");
	public final static By PERSON_TAB_RATES = By.xpath("//*[@id='field-engineers-tabs']/ul/li/a[text()='Rates']");
	public final static By PERSON_TAB_TECHNICAL_SKILLS = By.xpath("//*[@id='field-engineers-tabs']/ul/li/a[text()='Technical Skills']");
	public final static By PERSON_TAB_GENERAL_SKILLS = By.xpath("//*[@id='field-engineers-tabs']/ul/li/a[text()='General Skills']");
	public final static By PERSON_TAB_HISTORY = By.xpath("//*[@id='field-engineers-tabs']/ul/li/a[text()='History']");
	
	/** elements under address tab*/
	public final static By PERSON_BUTTON_ADD_ADDRESS = By.xpath("//*[@id='saveFE']/div/div[text()='Add Address'][contains(@style,'display: block;')]");
	// elements about add address
	public final static By PERSON_LABEL_ADDRESS_TYPE = By.xpath("//*[@id='feAddress']/div[3]/div[1]/div[1]/label");
	public final static By PERSON_SELECT_ADDRESS_TYPE = By.id("addressType");
	public final static By PERSON_LABEL_ADDRESS_NAME = By.xpath("//*[@id='feAddress']/div[3]/div[1]/div[2]/label");
	public final static By PERSON_INPUT_ADDRESS_NAME = By.xpath("//form[@id='feAddress']//*[@id='addressName']");
	public final static By PERSON_LABEL_ADDRESS_LINE_1 = By.xpath("//*[@id='feAddress']/div[3]/div[1]/div[3]/label");
	public final static By PERSON_INPUT_ADDRESS_LINE_1 = By.xpath("//form[@id='feAddress']//*[@id='addressLine1']");
	public final static By PERSON_LABEL_ADDRESS_LINE_2 = By.xpath("//*[@id='feAddress']/div[3]/div[1]/div[4]/label");
	public final static By PERSON_INPUT_ADDRESS_LINE_2 = By.xpath("//form[@id='feAddress']//*[@id='addressLine2']");
	public final static By PERSON_LABEL_ADDRESS_LINE_3 = By.xpath("//*[@id='feAddress']/div[3]/div[1]/div[5]/label");
	public final static By PERSON_INPUT_ADDRESS_LINE_3 = By.xpath("//form[@id='feAddress']//*[@id='addressLine3']");
	public final static By PERSON_LABEL_CITY = By.xpath("//*[@id='feAddress']/div[3]/div[2]/div[1]/label");
	public final static By PERSON_INPUT_CITY = By.xpath("//form[@id='feAddress']//*[@id='city']");
	public final static By PERSON_LABEL_STATE = By.xpath("//*[@id='feAddress']/div[3]/div[2]/div[2]/label");
	public final static By PERSON_SELECT_STATE = By.id("state");
	public final static By PERSON_LABEL_COUNTRY = By.xpath("//*[@id='feAddress']/div[3]/div[2]/div[3]/label");
	public final static By PERSON_SELECT_COUNTRY = By.id("country");
	public final static By PERSON_LABEL_ZIP_CODE = By.xpath("//*[@id='feAddress']/div[3]/div[2]/div[4]/label");
	public final static By PERSON_INPUT_ZIP_CODE = By.xpath("//form[@id='feAddress']//*[@id='zipOrPostalCode']");
	public final static By PERSON_BUTTON_CONTINUE_ADDRESS = By.xpath("//*[@id='feAddress']/div[1]/div[text()='Continue']");
	// icon of delete address
	public final static By PERSON_IMG_DELETE = By.xpath("//*[@id='feadresses']/div[2]/div/div[4]/table/tbody/tr[last()]/td[2]/div/img");
	public final static By PERSON_IMG_EDIT_HOME_BASE = By.xpath("//*[@id='feadresses']/div[2]/div/div[4]/table/tbody/tr/td/div[text()='Home Base']/../preceding-sibling::td[2]/div/img");
	public final static By PERSON_TD_ADDRESS_LINE_HOME_BASE = By.xpath("//*[@id='feadresses']/div[2]/div/div[4]/table/tbody/tr/td/div[text()='Home Base']/../following-sibling::td[1]");
	// error message element of edit a person's address line 1 with 'P.O. Box' 
	public final static By PERSON_SPAN_PO_BOX_ERROR_MESSAGE = By.id("addressLine1Error");
	public final static By PERSON_DIV_COUNTRIES = By.xpath(".//*[@id='feadresses']//td[@abbr='countryValue']/div");
	public final static By PERSON_DIV_ADDRESSES = By.xpath(".//*[@id='feadresses']//td[@abbr='address']/div");
	// record of address
	public final static By PERSON_TR_RECORDS_ADDRESS = By.xpath("//*[@id='feadresses']/div[2]/div/div[4]/table/tbody/tr");
	
	/** elements under about tab*/
	public final static By PERSON_LABEL_PHOTO_UPLOAD = By.xpath("//*[@id='feabout']/div[1]/div[1]/table/tbody/tr/td[2]/label");
	public final static By PERSON_INPUT_PHOTO_UPLOAD = By.id("photoUpload");
	public final static By PERSON_LABEL_RESOURCE_TYPE = By.xpath("//*[@id='feabout']/div[1]/div[2]/label");
	public final static By PERSON_SELECT_RESOURCE_TYPE = By.xpath(".//div[@id='feabout']//*[@id='employmentTypeCode']");
	public final static By PERSON_LABEL_FIRST_NAME = By.xpath("//*[@id='feabout']/div[1]/div[3]/label");
	public final static By PERSON_INPUT_FIRST_NAME = By.xpath(".//div[@id='feabout']//*[@id='firstName']");
	public final static By PERSON_LABEL_LAST_NAME = By.xpath("//*[@id='feabout']/div[1]/div[4]/label");
	public final static By PERSON_INPUT_LAST_NAME = By.xpath(".//div[@id='feabout']//*[@id='lastName']");
	public final static By PERSON_LABEL_JOB_TYPE = By.xpath("//*[@id='feabout']/div[1]/div[5]/label");
	public final static By PERSON_SELECT_JOB_TYPE = By.id("jobTypeCode");
	public final static By PERSON_LABEL_CLIENTS = By.xpath("//*[@id='feabout']/div[1]/div[6]/label/font");
	public final static By PERSON_SELECT_CLIENTS = By.id("assignedClientSet");
	public final static By PERSON_LABEL_JOB_TITLE = By.xpath("//*[@id='feabout']/div[1]/div[7]/label");
	public final static By PERSON_SELECT_JOB_TITLE = By.id("jobTitlteId");
	public final static By PERSON_LABEL_COMPANY_NAME = By.xpath("//*[@id='feCompanySelect']/label");
	public final static By PERSON_INPUT_COMPANY_NAME = By.xpath("//div[@id='feabout']//*[@id='feCompanyName']");
	public final static By PERSON_LABEL_RESOURCE_STATUS = By.xpath("//*[@id='feabout']/div[1]/div[9]/label");
	public final static By PERSON_SELECT_RESOURCE_STATUS = By.id("resourceStatusCode");
	public final static By PERSON_LABEL_STATUS_NOTES = By.xpath("//*[@id='feabout']/div[1]/div[10]/label");
	public final static By PERSON_INPUT_STATUS_NOTES = By.xpath("//div[@id='feabout']//*[@id='statusDescription']");
	public final static By PERSON_LABEL_SUPERVISOR_FIRST_NAME = By.xpath("//*[@id='feabout']/div[2]/div[1]/label");
	public final static By PERSON_INPUT_SUPERVISOR_FIRST_NAME = By.id("supFirstName");
	public final static By PERSON_LABEL_SUPERVISOR_LAST_NAME = By.xpath("//*[@id='feabout']/div[2]/div[2]/label");
	public final static By PERSON_INPUT_SUPERVISOR_LAST_NAME = By.id("supLastName");
	public final static By PERSON_LABEL_PLATFORM_ID = By.xpath("//*[@id='feabout']/div[2]/div[3]/label");
	public final static By PERSON_INPUT_PLATFORM_ID = By.id("platformId");
	public final static By PERSON_LABEL_HIRE_DATE = By.xpath("//*[@id='feabout']/div[2]/div[4]/label");
	public final static By PERSON_INPUT_HIRE_DATE = By.id("hireDate");
	public final static By PERSON_LABEL_TERMINATION_DATE = By.xpath("//*[@id='feabout']/div[2]/div[5]/label");
	public final static By PERSON_INPUT_TERMINATION_DATE = By.id("terminationDate");
	public final static By PERSON_LABEL_STANDARD_SCHEDULE = By.xpath("//*[@id='feabout']/div[2]/div[6]/label");
	public final static By PERSON_SELECT_STANDARD_SCHEDULE = By.id("standardWeeklyScheduleCode");
	public final static By PERSON_LABEL_HOLIDAY_SCHEDULE = By.xpath("//*[@id='feabout']/div[2]/div[7]/label");
	public final static By PERSON_INPUT_HOLIDAY_SCHEDULE = By.id("companyHolidaySchedule");
	public final static By PERSON_LABEL_ADD_WAREHOUSE = By.xpath("//*[@id='feabout']/div[2]/div[8]/label");
	public final static By PERSON_SELECT_ADD_WAREHOUSE = By.id("warehouseDrop");
	public final static By PERSON_LABEL_ASSOCIATED_WAREHOUSES = By.xpath("//*[@id='feabout']/div[2]/div[9]/label");
	public final static By PERSON_DIV_ASSOCIATED_WAREHOUSES = By.xpath("//*[@id='feabout']/div[2]/div[10]");
	public final static By PERSON_INPUT_SP_LOGIN_ACCESS = By.xpath("//div[@id='feabout']//*[@id='spLoginAccessInd']");
	public final static By PERSON_LABEL_SP_LOGIN_ACCESS = By.xpath("//*[@id='feabout']/div[2]/div[11]/strong[1]");
	public final static By PERSON_INPUT_SC_LOGIN_ACCESS = By.xpath("//div[@id='feabout']//*[@id='scLoginAccessInd']");
	public final static By PERSON_LABEL_SC_LOGIN_ACCESS = By.xpath("//*[@id='feabout']/div[2]/div[11]/strong[2]");
	
	/** elements under Contact Info tab*/
	public final static By PERSON_BUTTON_ADD_CONTACT = By.xpath("//*[@id='saveFE']/div/div[text()='Add Contact'][contains(@style,'display: block')]");
	// elements about add contact
	public final static By PERSON_BUTTON_CONTINUE_CONTACT = By.xpath("//*[@id='feContact']/div[1]/div[2]");
	public final static By PERSON_LABEL_CONTACT_METHOD = By.xpath("//*[@id='feContact']/div[3]/div[1]/div[1]/label");
	public final static By PERSON_SELECT_CONTACT_METHOD = By.id("contactMethodType");
	public final static By PERSON_LABEL_CONTACT_DETAILS = By.xpath("//*[@id='feContact']/div[3]/div[1]/div[2]/label");
	public final static By PERSON_INPUT_CONTACT_DETAILS = By.id("value");
	public final static By PERSON_LABEL_PHONE_COUNTRY_CODE = By.xpath("//*[@id='feContact']/div[3]/div[2]/div[1]/label");
	public final static By PERSON_INPUT_PHONE_COUNTRY_CODE = By.id("phoneCountryCode");
	public final static By PERSON_LABEL_PHONE_EXT = By.xpath("//*[@id='feContact']/div[3]/div[2]/div[2]/label");
	public final static By PERSON_INPUT_PHONE_EXT = By.id("phoneExtension");
	// if person's contact changed and saved successfully, a message should be displayed.
	public final static By PERSON_STRONG_SAVED = By.xpath("//*[@id='save-notification-fe']/strong");
	// record of contact
	public final static By PERSON_TR_RECORDS_CONTACT = By.xpath("//*[@id='fecontacts']/div[2]/div/div[4]/table/tbody/tr");
	// icon of edit/delete contact
	public final static By PERSON_IMG_DELETE_CONTACT = By.xpath("//*[@id='fecontacts']/div[2]/div/div[4]/table/tbody/tr[last()]/td[2]/div/img");
	public final static By PERSON_IMG_EDIT_CONTACT = By.xpath("//*[@id='fecontacts']/div[2]/div/div[4]/table/tbody/tr/td/div[text()='Work Email Address']/../preceding-sibling::td[2]/div/img");
	public final static By PERSON_TD_CONTACT_DETAILS_CONTACT = By.xpath("//*[@id='fecontacts']/div[2]/div/div[4]/table/tbody/tr/td/div[text()='Home Email Address']/../following-sibling::td[1]");
	
	/** elements under Rates tab*/
	public final static By PERSON_BUTTON_ADD_NEW_RATES = By.xpath("//*[@id='saveFE']/div/div[text()='Add New Rate'][contains(@style,'display: block')]");
	public final static By PERSON_TABLE_RATES_RESULTS = By.className("resourcebillingrates");
	public final static By PERSON_SELECT_BILLING_RATE_STATUS = By.id("billingRateStatusCode");
	public final static By PERSON_SELECT_RATE_BASIS = By.id("rbrPayTypeCode");
	public final static By PERSON_INPUT_AMOUNT = By.id("amount");
	public final static By PERSON_SELECT_CURRENCY = By.id("currencyCode");
	public final static By PERSON_BUTTON_CONTINUE_RATE = By.xpath("//*[@id='resourceBillingRate']/div[1]/div[2]");
	// records of rates
	public final static By PERSON_TR_RECORDS_RATES = By.xpath("//*[@id='resourcerates']/div[2]/div/div[4]/table/tbody/tr");
	// the last rate set edit icon
	public final static By PERSON_IMG_EDIT_RATE = By.xpath("//*[@id='resourcerates']/div[2]/div/div[4]/table/tbody/tr[last()]/td[1]/div/img");
	// the last rate set delete icon
	public final static By PERSON_IMG_DELETE_RATE = By.xpath("//*[@id='resourcerates']/div[2]/div/div[4]/table/tbody/tr[last()]/td[2]/div/img");
	// the last rate of rate list
	public final static By PERSON_DIV_RATE_STATUS = By.xpath("//*[@id='resourcerates']/div[2]/div/div[4]/table/tbody/tr[last()]/td[3]/div");
	
	/** elements under Teachcial skills tab*/
	public final static By PERSON_STONG_SKILL_TYPE = By.xpath("//*[@id='techSkillsGroup']/table/tbody/tr[2]/td[1]/strong");
	public final static By PERSON_SELECT_SKILL_TYPE = By.id("feAssetType");
	public final static By PERSON_SELECT_SKILL_TYPE_EDIT = By.id("feAssetTypeOverlay");
	public final static By PERSON_STONG_MANUFACTURER = By.xpath("//*[@id='techSkillsGroup']/table/tbody/tr[2]/td[2]/strong");
	public final static By PERSON_SELECT_MANUFACTURER = By.id("manufacturerId");
	public final static By PERSON_SELECT_MANUFACTURER_EDIT = By.id("manufacturerIdOverlay");
	public final static By PERSON_STONG_PROD_FAMILY = By.xpath("//*[@id='techSkillsGroup']/table/tbody/tr[2]/td[3]/strong");
	public final static By PERSON_SELECT_PROD_FAMILY = By.id("feAssetSubType");
	public final static By PERSON_SELECT_PROD_FAMILY_EDIT = By.id("feAssetSubTypeOverlay");
	public final static By PERSON_STONG_PROFICIENCY = By.xpath("//*[@id='techSkillsGroup']/table/tbody/tr[2]/td[4]/strong");
	public final static By PERSON_SELECT_PROFICIENCY = By.id("proficiencyTypeId");
	public final static By PERSON_STONG_DISPATCH_PREF = By.xpath("//*[@id='techSkillsGroup']/table/tbody/tr[2]/td[5]/strong");
	public final static By PERSON_SELECT_DISPATCH_PREF = By.id("skillDispatchingType");
	public final static By PERSON_BUTTON_ADD_SKILL_SETS_TECHNICAL = By.id("create-techskillset-btn");
	public final static By PERSON_BUTTON_CONTINUE_EDIT_SKILL_SET_TECHNICAL = By.xpath("//*[@id='techSkillGroupOverlay']/div[1]/div[text()='Continue']");
	// the last skill set edit icon
	public final static By PERSON_IMG_EDIT_LAST_TECHNICAL_SKILL_SET = By.xpath("//*[@id='resourcetechnicalskills']/div[3]/div/div[4]/table/tbody/tr[last()]/td[1]/div/img");
	// the last skill set delete icon
	public final static By PERSON_IMG_DELETE_LAST_TECHNICAL_SKILL_SET = By.xpath("//*[@id='resourcetechnicalskills']/div[3]/div/div[4]/table/tbody/tr[last()]/td[2]/div/img");
	// the last certificate of certificates list
	public final static By PERSON_DIV_LAST_TECHNICAL_SKILL_SET = By.xpath("//*[@id='resourcetechnicalskills']/div[3]/div/div[4]/table/tbody/tr[last()]/td[3]/div");
	// records of technical skills sets
	public final static By PERSON_TR_RECORDS_SKILL_SETS_TECHNICAL = By.xpath("//*[@id='resourcetechnicalskills']/div[3]/div/div[4]/table/tbody/tr");
	// elements of add new certificate
	public final static By PERSON_BUTTON_ADD_NEW_CERTIFICATE = By.xpath("//*[@id='saveFE']/div/div[text()='Add New Certificate'][contains(@style,'display: block')]");
	public final static By PERSON_TR_UPLOAD_FILE = By.xpath("//*[@id='resourcetechnicalskills']/div[5]/div/div[4]/table/tbody/tr");
	public final static By PERSON_LABEL_CERTICATE_NAME = By.xpath("//*[@id='feTechnnicalCertificate']/div[3]/div[1]/div[1]/label");
	public final static By PERSON_SELECT_CERTICATE_NAME = By.id("abstractCertificateId");
	public final static By PERSON_LABEL_TEST_NAME = By.xpath("//*[@id='feTechnnicalCertificate']/div[3]/div[1]/div[2]/label");
	public final static By PERSON_LABEL_ASSET_MODEL = By.xpath("//*[@id='feTechnnicalCertificate']/div[3]/div[1]/div[3]/label");
	public final static By PERSON_LABEL_PRODUCT_FAMILY = By.xpath("//*[@id='feTechnnicalCertificate']/div[3]/div[1]/div[4]/label");
	public final static By PERSON_LABEL_CERTIFICATION_DATE = By.xpath("//*[@id='feTechnnicalCertificate']/div[3]/div[2]/div[1]/label");
	public final static By PERSON_INPUT_CERTIFICATION_DATE = By.id("certStartDate");
	public final static By PERSON_LABEL_EXPIRATION_DATE = By.xpath("//*[@id='feTechnnicalCertificate']/div[3]/div[2]/div[2]/label");
	public final static By PERSON_INPUT_EXPIRATION_DATE = By.id("certExpirationDate");
	public final static By PERSON_LABEL_DESCRIPTION = By.xpath("//*[@id='feTechnnicalCertificate']/div[3]/div[2]/div[3]/label");
	public final static By PERSON_INPUT_DESCRIPTION= By.id("description");
	public final static By PERSON_LABEL_UPLOAD_CERTIFICATION = By.xpath("//*[@id='feTechnnicalCertificate']/div[3]/div[2]/div[4]/label");
	public final static By PERSON_INPUT_UPLOAD_CERTIFICATION = By.id("techCertificateLogo");
	public final static By PERSON_LABEL_UPLOAD_FILE = By.xpath("//*[@id='feTechnnicalCertificate']/div[3]/div[2]/div[5]/label");
	public final static By PERSON_LINK_UPLOAD_FILE = By.xpath("//*[@id='uploaded-file-path-tech']/a");
	public final static By PERSON_DIV_DISPATCH_PREF = By.xpath("//*[@id='resourcetechnicalskills']/div[3]/div/div[4]/table/tbody/tr/td[7]/div");
	public final static By PERSON_DIV_SKILL_TYPE = By.xpath("//*[@id='resourcetechnicalskills']/div[3]/div/div[4]/table/tbody/tr/td[3]/div");
	public final static By PERSON_BUTTON_CONTINUE_ADD_CERTIFICATE = By.xpath("//*[@id='feTechnnicalCertificate']/div[1]/div[3]");
	// records of technical certificate
	public final static By PERSON_TR_RECORDS_CERTIFICATE_TECHNICAL = By.xpath("//*[@id='resourcetechnicalskills']/div[5]/div/div[4]/table/tbody/tr");
	// the last certificate edit icon
	public final static By PERSON_IMG_EDIT_LAST_TECHNICAL_CERTIFICATE = By.xpath("//*[@id='resourcetechnicalskills']/div[5]/div/div[4]/table/tbody/tr[last()]/td[1]/div/img");
	// the last certificate delete icon
	public final static By PERSON_IMG_DELETE_LAST_TECHNICAL_CERTIFICATE = By.xpath("//*[@id='resourcetechnicalskills']/div[5]/div/div[4]/table/tbody/tr[last()]/td[2]/div/img");
	// the last certificate of certificates list
	public final static By PERSON_DIV_LAST_TECHNICAL_CERTIFICATE = By.xpath("//*[@id='resourcetechnicalskills']/div[5]/div/div[4]/table/tbody/tr[last()]/td[3]/div");

	/** elements under general skills tab*/
	public final static By PERSON_STRONG_SKILL_TYPE_GENERAL_SKILLS = By.xpath("//*[@id='feGenSkillsGroup']/table/tbody/tr[2]/td[1]/strong");
	public final static By PERSON_SELECT_SKILL_TYPE_GENERAL_SKILLS = By.id("abstractSkillTypeCode");
	public final static By PERSON_SELECT_SKILL_TYPE_GENERAL_SKILLS_EDIT = By.id("abstractSkillTypeCodeOverlay");
	public final static By PERSON_STRONG_SKILL_NAME_GENERAL_SKILLS = By.xpath("//*[@id='feGenSkillsGroup']/table/tbody/tr[2]/td[2]/strong");
	public final static By PERSON_SELECT_SKILL_NAME_GENERAL_SKILLS = By.id("abstractGenSkillId");
	public final static By PERSON_SELECT_SKILL_NAME_GENERAL_SKILLS_EDIT = By.id("abstractGenSkillIdOverlay");
	public final static By PERSON_BUTTON_ADD_GENERAL_SKILL = By.xpath("//*[@id='feGenSkillsGroup']/table/tbody/tr/td/div[text()='Add Skill Sets'][@id='create-genskillset-btn']");
	public final static By PERSON_BUTTON_CONTINUE_EDIT_GENERAL_SKILL = By.xpath("//*[@id='feGeneralSkillsGroupOverlay']/div[1]/div[text()='Continue']");
	// the last record's edit/delete icon of general skills list
	public final static By PERSON_IMG_EDIT_LAST_RECORD_GENERAL_SKILL= By.xpath("//*[@id='resourcegeneralskills']/div[3]/div/div[4]/table/tbody/tr[last()]/td[1]/div/img");
	public final static By PERSON_IMG_DELETE_LAST_RECORD_GENERAL_SKILL= By.xpath("//*[@id='resourcegeneralskills']/div[3]/div/div[4]/table/tbody/tr[last()]/td[2]/div/img");
	// records of general skills list
	public final static By PERSON_TR_RECORDS_GENERAL_SKILLS = By.xpath("//*[@id='resourcegeneralskills']/div[3]/div/div[4]/table/tbody/tr");
	public final static By PERSON_DIV_LAST_SKILL_TYPE = By.xpath("//*[@id='resourcegeneralskills']/div[3]/div/div[4]/table/tbody/tr[last()]/td[3]/div");
	// elements of add new certificate under general skills tab
	public final static By PERSON_BUTTON_ADD_NEW_CERTIFICATE_GENERAL_SKILLS = By.xpath("//*[@id='saveFE']/div/div[text()='Add New Certificate'][contains(@style,'display: block')]");
	public final static By PERSON_LABEL_CERTICATE_TYPE_GENERAL_SKILLS = By.xpath("//*[@id='feGeneralCertificate']/div[3]/div[1]/div[1]/label");
	public final static By PERSON_SELECT_CERTICATE_TYPE_GENERAL_SKILLS = By.id("generalAbstractCertificateTypeId");
	public final static By PERSON_LABEL_CERTICATE_NAME_GENERAL_SKILLS = By.xpath("//*[@id='feGeneralCertificate']/div[3]/div[1]/div[2]/label");
	public final static By PERSON_SELECT_CERTICATE_NAME_GENERAL_SKILLS = By.id("generalAbstractCertificateId");
	public final static By PERSON_LABEL_TEST_NAME_GENERAL_SKILLS = By.xpath("//*[@id='feGeneralCertificate']/div[3]/div[1]/div[3]/label");
	public final static By PERSON_LABEL_CERTIFICATION_DATE_GENERAL_SKILLS = By.xpath("//*[@id='feGeneralCertificate']/div[3]/div[2]/div[1]/label");
	public final static By PERSON_INPUT_CERTIFICATION_DATE_GENERAL_SKILLS = By.id("generalCertStartDate");
	public final static By PERSON_LABEL_EXPIRATION_DATE_GENERAL_SKILLS = By.xpath("//*[@id='feGeneralCertificate']/div[3]/div[2]/div[2]/label");
	public final static By PERSON_INPUT_EXPIRATION_DATE_GENERAL_SKILLS = By.id("generalCertExpirationDate");
	public final static By PERSON_LABEL_DESCRIPTION_GENERAL_SKILLS = By.xpath("//*[@id='feGeneralCertificate']/div[3]/div[2]/div[3]/label");
	public final static By PERSON_INPUT_DESCRIPTION_GENERAL_SKILLS= By.id("generalCertDescription");
	public final static By PERSON_LABEL_UPLOAD_CERTIFICATION_GENERAL_SKILLS = By.xpath("//*[@id='feGeneralCertificate']/div[3]/div[2]/div[4]/label");
	public final static By PERSON_INPUT_UPLOAD_CERTIFICATION_GENERAL_SKILLS = By.id("generalCertificateLogo");
	public final static By PERSON_LABEL_UPLOAD_FILE_GENERAL_SKILLS = By.xpath("//*[@id='feGeneralCertificate']/div[3]/div[2]/div[5]/label");
	public final static By PERSON_BUTTON_CONTINUE_GENERAL_SKILLS = By.xpath("//*[@id='feGeneralCertificate']/div[1]/div[text()='Continue']");
	// the last record's edit/delete icon of general skills list
	public final static By PERSON_IMG_EDIT_LAST_RECORD_GENERAL_CERTIFICATE= By.xpath("//*[@id='resourcegeneralskills']/div[5]/div/div[4]/table/tbody/tr[last()]/td[1]/div/img");
	public final static By PERSON_IMG_DELETE_LAST_RECORD_GENERAL_CERTIFICATE= By.xpath("//*[@id='resourcegeneralskills']/div[5]/div/div[4]/table/tbody/tr[last()]/td[2]/div/img");
	// records of general certificate list
	public final static By PERSON_TR_RECORDS_GENERAL_CERTIFICATE = By.xpath("//*[@id='resourcegeneralskills']/div[5]/div/div[4]/table/tbody/tr");
	public final static By PERSON_DIV_LAST_CERTIFICATE_NAME = By.xpath("//*[@id='resourcegeneralskills']/div[5]/div/div[4]/table/tbody/tr[last()]/td[3]/div");
	
	
	/** elements under history tab*/
	public final static By PERSON_TR_RECORDS = By.xpath("//*[@class='flexresourcehistory']/tbody/tr");
	public final static By PERSON_DIV_CLIENT_NAME = By.xpath("//div[@id='resourcehistories']//th/div[text()='Client Name']");
	public final static By PERSON_DIV_TICKET_NUMBER = By.xpath("//div[@id='resourcehistories']//th/div[text()='Ticket #']");
	public final static By PERSON_DIV_OPEN_DATE = By.xpath("//div[@id='resourcehistories']//th/div[text()='Opened Date']");
	public final static By PERSON_DIV_CLOSE_DATE = By.xpath("//div[@id='resourcehistories']//th/div[text()='Closed Date']");
	public final static By PERSON_DIV_STATUS = By.xpath("//div[@id='resourcehistories']//th/div[text()='Status']");
	public final static By PERSON_SELECT_PAGE = By.name("rp");
	public final static By PERSON_DIV_FIRST = By.xpath("//div[@class='pFirst pButton']");
	public final static By PERSON_DIV_PREVIOUS = By.xpath("//div[@class='pPrev pButton']");
	public final static By PERSON_INPUT_PAGE = By.xpath("//span[@class='pcontrol']/input");
	public final static By PERSON_SPAN_PAGE = By.xpath("//span[@class='pcontrol']/span");
	public final static By PERSON_DIV_NEXT = By.xpath("//div[@class='pNext pButton']");
	public final static By PERSON_DIV_LAST = By.xpath("//div[@class='pLast pButton']");
	public final static By PERSON_DIV_REFRESH = By.xpath("//div[@class='pReload pButton']");
	public final static By PERSON_DIV_FOOTER = By.className("pDiv2");
	// on history tab the edit and delete icon should not be found
	public final static By PERSON_IMG_EDIT_ICON = By.xpath("//*[@id='resourcehistories']//img[@src='/images/edit.png']");
	public final static By PERSON_IMG_DELETE_ICON = By.xpath("//*[@id='resourcehistories']//img[@src='/images/edit.png']");
	
	// person's status information
	public final static By PERSON_DIV_INFO = By.id("fesid");
	
	// elements of error message when add a duplicate person
	public final static By PERSON_DIV_ERROR_MESSAGE_DIALOG = By.id("create-existing-dialog-form");
	public final static By PERSON_IMG_EDIT_DUPLICATE_PERSON = By.xpath("//*[@id='existingfelist']/div[2]/div/div[4]/table/tbody/tr/td[1]/div/img");
	public final static By PERSON_BUTTON_CLOSE_EXISTING_RECORD = By.id("existingRecordDialogClose");
	// elements of adding duplicate name pop-up window
	public final static By PERSON_STRONG_ADD_DUPLICATE_NAME_MESSAGE = By.xpath("//*[@id='create-existing-dialog-form']/div[1]/strong");
	
	public final static void waitForPersonPageLoad(){
		SeleniumUtil.waitOnElements(new By[]{
				PERSON_BUTTON_CLOSE, PERSON_BUTTON_SAVE, PERSON_TAB_ABOUT, PERSON_TAB_ADDRESS, 
				PERSON_TAB_CONTRACT_INFO, PERSON_TAB_RATES, PERSON_TAB_TECHNICAL_SKILLS, 
				PERSON_TAB_GENERAL_SKILLS, PERSON_TAB_HISTORY
		});
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(PERSON_BUTTON_CLOSE)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(PERSON_BUTTON_SAVE)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(PERSON_TAB_ABOUT)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(PERSON_TAB_ADDRESS)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(PERSON_TAB_CONTRACT_INFO)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(PERSON_TAB_RATES)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(PERSON_TAB_TECHNICAL_SKILLS)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(PERSON_TAB_GENERAL_SKILLS)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(PERSON_TAB_HISTORY)));
	}
	
	/**
	 * enter History tab.
	 * 
	 * History
	 * Date        Ver Author        Change Description
	 * ----------- --- ------------- ----------------------------------------
	 * 31 May 2013 002 Karl          Create, add function to navigate to tabs, etc.
	 * */
	public final static void enterHistoryTab(){
		SeleniumUtil.click(SeleniumUtil.findElement(PERSON_TAB_HISTORY));
		SeleniumUtil.waitForFixedMilliseconds(1000);
	}
	
	/**
	 * Assume current tab is history, get history record page count.
	 * 
	 * History
	 * Date        Ver Author        Change Description
	 * ----------- --- ------------- ----------------------------------------
	 * 31 May 2013 002 Karl          Create, add function to navigate to tabs, etc.
	 * */
	public final static int getHistoryRecordsPerPage(){
		return Integer.parseInt(new Select(SeleniumUtil.findElement(PERSON_SELECT_PAGE)).getFirstSelectedOption().getText());
	}
	
	/**
	 * Assume current tab is history, get current page no(from index 1).
	 * 
	 * History
	 * Date        Ver Author        Change Description
	 * ----------- --- ------------- ----------------------------------------
	 * 31 May 2013 002 Karl          Create, add function to navigate to tabs, etc.
	 * */
	public final static int getHistoryPageIndex(){
		return Integer.parseInt(SeleniumUtil.findElement(PERSON_INPUT_PAGE).getAttribute("value").trim());
	}
	
	/**
	 * Assume current tab is history, get history record page count.
	 * 
	 * History
	 * Date        Ver Author        Change Description
	 * ----------- --- ------------- ----------------------------------------
	 * 31 May 2013 002 Karl          Create, add function to navigate to tabs, etc.
	 * */
	public final static int getHistoryPageCount(){
		return Integer.parseInt(SeleniumUtil.findElement(PERSON_SPAN_PAGE).getText().trim());
	}
	
	/**
	 * Assume current tab is history, get history record count
	 * 
	 * History
	 * Date        Ver Author        Change Description
	 * ----------- --- ------------- ----------------------------------------
	 * 31 May 2013 002 Karl          Create, add function to navigate to tabs, etc.
	 * */
	public final static int getHistoryRecordCount(){
		return SeleniumUtil.findElements(PERSON_TR_RECORDS).size();
	}
	
	/**
	 * Assume current tab is history, wait for "loading" word on current page to disappear
	 * 
	 * History
	 * Date        Ver Author        Change Description
	 * ----------- --- ------------- ----------------------------------------
	 * 31 May 2013 002 Karl          Create, add function to navigate to tabs, etc.
	 * */
	public final static void waitForHistoryLoading(){
		SeleniumUtil.waitForExepectedConditionUntilTimeOutInMilliseconds(
			new ExpectedCondition<Boolean>(){
				public Boolean apply(WebDriver arg0) {
					String text = SeleniumUtil.findElement(PERSON_DIV_FOOTER).getText().trim();
					return !text.contains("Processing");
				}
			}, 
			6000, "Refreshing didn't done within 6 seconds. Please check if web site performs ok.");
	}
}
